<style lang="scss">
@import "@/assets/css/variable";
.case {
  position: absolute;
  font-family: "SimHei";
  top: 0;
  bottom: $tabbar-height;
  width: 100%;
  background-color: $main-bgc;
  min-height: 100%;
  font-size: 1.2rem;
  overflow: auto;
  box-sizing: border-box;
  padding: 12px 0;
  .swipe_up {
    width: 100%;
    // height: 8rem;
    padding-bottom: 10px;
    border-radius: 0 0 20% 20%;
    .h_title {
      color: white;
      font-size: 1.4rem;
      line-height: 6rem;
      margin-left: 25px;
      font-family: "SimHei";
      span {
        font-weight: 600;
      }
    }
  }
  .swipe_down {
    width: 100%;
    display: flex;
    justify-content: center;
    border-radius: 8px;
    // margin-bottom: 10px;
    .swipe_van {
      text-align: center;
      width: 90%;
      // height: 13rem;
      margin-top: -2rem;
      border-radius: 8px;
      text-align: center;
    }
  }
}
</style>
<template>
  <div class="case">
      <div style="margin-left: 12px"><BarNav :is_status="'1'"></BarNav></div>
    <!-- <div class="padding-all">
      <div>code:{{code}}</div>
      <div>openid:{{openid}}</div>
      <div>appid:{{appid}}</div>
    </div> -->
    <!-- <div class="swipe_up" :style="{ backgroundColor: $store.getters.getMasterColor }">
       <div class="h_title">我们为所有商户吸引了 <span>{{fansInfo.browse_num}}</span> 人</div>
    </div>
    <div class="swipe_down">
      <div class="swipe_van">
         <my-swipe ></my-swipe>
      </div>
    </div> -->
    
    <my-case-tabs :model="model"></my-case-tabs>
    <div class="tabbar-height"></div>
  </div>
</template>

<script>
// @ is an alias to /src
import mySwipe from "@/components/Swipe.vue";
import myCaseTabs from "@/components/CaseTabs.vue";
import { myMixins } from "@/assets/js/mixins.js";
import BarNav from "@/components/BarNav";
export default {
  name: "Case",
  mixins: [myMixins],
  components: {
    mySwipe,
    myCaseTabs,
    BarNav
  },
  data() {
    return {
      code: "",
      openid: "",
      access_token: "",
      appid: "",
      config: "",
      fansInfo: {},
      model: ''
    };
  },
  created() {
    document.title = '案例展示'
    this.model = this.$route.query.model
    // console.log(this.$route.query.model, 'this.$route.query.model');
  },
  mounted() {
    this.code = this.$store.state.code;
    if (process.env.NODE_ENV == "production") {
      //线上环境
      this.openid = localStorage.getItem("OPENID") || "没获取到";
    } else {
      this.openid = this.$store.state.openid;
    }
    this.access_token = this.$store.state.access_token;
    this.appid = this.$store.state.appid;
    // this.configItemShare()
    this.ConfigItem();
    this.getActivityFans()
    // console.log("=========sharetitle=======",this.sharetitle)
    if(localStorage.getItem('tabbar')){
      const tabbar = JSON.parse(localStorage.getItem('tabbar'));
      // document.title = tabbar[0].text
    }
    
    console.log('案例展示')
  },
  methods: {
    ConfigItem() {
      const _this = this;
      let params = {};
      _this.$request.ConfigItem(params).then((res) => {
        console.log("=======ConfigItemres==========", res);
        const config = res.data.value;
        // document.title = config.titleH5;
        console.log("=======ConfigItemres==========", config.titleH5);
        console.log("config", config);
        localStorage.setItem("masterColor", config.color);
        console.log("====masterColor====", localStorage.getItem("masterColor"));
      });
    },
    tabClick(index) {
      console.log(index);
    },
    getActivityFans() {
      let params = {
        openid: this.openid
      }
      console.log("params", params)
      this.$request.getActivityFans(params).then(res=>{
        console.log('res', res)
        this.fansInfo = res.data
      })
    }
  },
};
</script>
